class Greeter {
    greeting: string;
    constructor(message: string) {
        this.greeting = message;
    }
    greet() {
        alert("my name is tom!")
    }
}

let greeter = new Greeter('world');
greeter.greet();